Authentication/QueryString: fixes and tests