Bugfixes to init.d script