Make errors testable by fixing bugs