Fix compilation bugs except 'const'