Fixes problem when using with the enhanced for loop

Should also fixes the problem of not matching the negative rule.