fix constness.
fix clang build.
Merge branch 'develop' into oldschool