Added more tests for entity and helper functions