fixed errors in 'for' loop parsing