Allow the main loop to return an error to the caller
Add more logging to startup