Fix Query->hasFrom()
Fix generation of FROM and WHERE clauses