Added protection for wrong paths for lock and pid files