Properly abort commits. Fixes #376