Fix some issues : space missing in queries before "order by"