Set exit code to -1 if it is nil