For query, question mark is now optional.
Added safety tests