Fix bugs caused by sending empty chunks and single chunks