Added check for empty query in getParams.