fix a bug in single point queries and better error handling