Fix IAR casting errors