Fixed authentication checks to be else if not independent if checks as
they are no longer returning in the if block.