Authentication and authorization fixes