CHG: Added changes from svn (Fixed some warnings, improved ARM calculation)