Fixed authentication on logout bug & proper error messages on invalid use.