Updated to not write transactions when server errors.

This is for issue #17.