Fix sequences not working in foreach