Catch missing arguments for Query()

Also improved error message on Exec() for consistency.