Correct auth issues. Fixes #37, #48