Some query changes to close  #47.