Cleanup a bit and fixup auth code to what it might be