Base: Improve error handling