Handle query strings, better console handling