Issue #4589: Fix bugs of init function not defined