fix bugs in PigPlatform native codes