Fixed up queries for production