Follow-up for issue #9185: Incorrect initialization when hooks are present