Fixed bug in UDP flush()