fixed return codes to be "correct"