Fix syntax error on foreach sequence