Add tests for failure cases.