EntityWithMetadata: setter checks only root fix

This should fixes #248
Merge pull request #249 from stoewer/master

EntityWithMetadata: setter checks only root fix