Changed serialized type to unsigned char and fixed compile warning