Better error handling, and comment wrappers