Fixed a lot of compilation error