Added further tests, fixed hydrateEntity bug