Fix bug: pid become zero when pid file is empty