Fix some build bugs