Partially fixes a bug introduced in #18

Pull #18 introduces a bug that stops any authentication from working at all. I still can't get this to work, but it certainly helps.