Fixed error relating to decorators. Reworked some of the entity classes
to work better with decorators.