Changes to improve the init.d behavior