fixing compiling bugs and some typos of last commit