Some enhancements for dynamic_arch and some warning fixes

Some enhancements for dynamic_arch and some warning fixes