Network encoding fixes. Hopefully I've solved this problem for eternity.