Fixed bug where setting user authentication header could raise a null exception.