Clean up auth test slightly
Add anon. functions so that defers are executed where expected.
Merge pull request #2158 from lavalamp/fix

Clean up auth test slightly