Fixing query building for MLT