Cleanup fixes.
Better hooking, less trickery.