Cleaned, improved and fixed tests on entities