Fixed an issue causing a warning in the destructor.