Authorization: Completion

Added finishing touches to authentication logic.
Minor authentication bug fixes.