Fixed issues with log and pid files