Fixed bug with 'sqlQuery' function