exit code hanlding tweaks