Fixed bug in pre-initialization hook