Updated Query-Ids and Query-Keywords functions.