fix bugs for test compile