fix problems in init.d script