Added ability to specify return codes.