Fixed problems caused by stale pid files.