Improve error handling, add verbose message output option