Fix issue with Entity serialization.