Fixed a bug with Generic EmbeddedModels in the query compiler