Fixed all the compile bugs