Fix returned codes