Fix null errors for terminate method.
Update spec tests