Fixes #37: Multiple hook instances created due to serialization.