fix syntax errors in init porting & add script