Fix typos and minor bugs for init script