Fixed small query problem