various improvements and bugfixes in the init script