Fixed compiling bugs