Fixed iar support

Modified code so that iar support is now functional.