Fix Github issue #3: Implement exception detection.