Improved error handling & more