Fixed error that was causing unit tests to fail.

* Fixed transaction errors that happen during tests and added comment explaining the root cause.
* Fixed the ContactForm so that those unit tests pass again.