Fixes bug: stale LAST_POS(f) is not being reset