Fix dependencies. Rewrite init script.