Fix: Wrong encoding/decoding of packages in terms of length