Adjust build scripts to allow using clang. Fixed some warnings reported by clang
Fix aminfo crash on release builds.