Updates to error handling
Cleanup