Fix build bugs