Simplified exception handling. This closes #16.