Improve error handling and control over error results