fixed some compile bugs