Improve error handling and actually test some of it.