Fixed premature death bug from return code logic