Implemented startup and error handling functions.