Fixing loop bounds