Fix entities in client code.

Fix #30
Add test for entity in client code, see #30.
Merge pull request #38 from Drup/master

Fix entities in client code.