Fixed a scoping problem in entity dsl