Some fixes and authorization