Fixed formatting.
Only set name of entity when we need to.
More tests.
Formatting