Added suppor for __destruct and __unload.