Improved error handling; Improved authentication