Fixed bad auth functions and added extra tests.