WIP Fix packet size validation and error detection