fix scoping of builtin loops #16