Fix max_packet_size issue mentioned in #44