More related bug fixes.
Merge pull request #53 from mogupta/parent-entity-allocateKey-fix

More related bug fixes.