Bugfixes and improvements

* Handle auth error
* Handle results with NULL values
* Convert a selected few number types to lua numbers