Fix bug with numeric keys in query