Make the inactivate sub a bit smarter. May fix the recurring doublefree/coredump VAC issue.