Cleanups, made Error an enum class, changed struct Packet.