Fix bug that caused the program to crash if sending too much data.