Properly handle returncodes.