Catch more edge cases in EntityInfo

The most important issue this patch fixes is the "backwards
compatibility" that got removed in the previous patch. The
implementation tried to access the first character if the value
was a string (old format) and not an array. But it should throw a
RuntimeException.

Change-Id: I9391f2c5d33eab8f3a34c407396387dac018ec06
Merge "Catch more edge cases in EntityInfo"