Updated some changes and additions for set_query()