Fix entityMetadata reads

Seems to have been broken at some point. This pull request fixes it.
Merge pull request #87 from innoying/patch-1

Fix entityMetadata reads