fix broken init command and add test
Merge pull request #17 from idottv/fix/init_crash

fix broken init command and add test