Some fix and improvements for init callback