Fix most of the compile bugs.