Fixes issue where new flag would get reset by key repeat