Fixed some build bugs