Fix a critical bug in MPackage.