Add error handling to background commits.

Closes #88.