Fixing SQLQuery to SQLSelect for master compatibility

You should drop the pass by reference on $query. It doesn't do that anymore. :)