Some bugfixes for init scripts