Fixes extends within a loop.