Fixing query value type typing