Return correct codes when test fails