Made slight modifications to entity system.