More bug fixes and authorization handling stuff.