Adding more error handling for graceful termination (WIP).