Small fixes

A small bug fix. On the Apple compiler, the macro did not work properly
when checking for the query error string. The queries kept returning
“QUERY_ERROR”