Fix entity definition as per BZ 1122261

Also: improve the output of error messages in test case `LongMessageTestCase`.
Merge pull request #1088 from Ichimonji10/minor-fixes

Fix entity definition as per BZ 1122261