Fix for-loop regression