Document all error handling. Closes #7.