Fixed a mistake in finalizer.