Fixed bug in Query error reporting