Fix bug preventing proc queries from working in ruby versions < 1.9