Some minor fixes in record_dist
Implemented use of an empty block to indicate the end of data transmission