Partionally fixed the file pieceCount bug