Fix variable name typo
Fix bugs in init scripts