Fixed up queries