Fixes the dictionary query syntax properly for all db's