Merge pull request #27 from msouth/master

Fix for a couple of bugs in the new auth code