diff --git a/VersionASM b/VersionASM
index 76d2e63e79f283195308b6d0bd4fdf1bde9f6087..1316be77aaad581ba16ee9dd328f6e29f8aa23e9 100644
--- a/VersionASM
+++ b/VersionASM
@@ -13,11 +13,11 @@
                         GBLS    Module_ComponentPath
 Module_MajorVersion     SETS    "5.35"
 Module_Version          SETA    535
-Module_MinorVersion     SETS    "4.79.2.98.2.48"
-Module_Date             SETS    "08 Aug 2011"
-Module_ApplicationDate  SETS    "08-Aug-11"
+Module_MinorVersion     SETS    "4.79.2.98.2.49"
+Module_Date             SETS    "22 Aug 2011"
+Module_ApplicationDate  SETS    "22-Aug-11"
 Module_ComponentName    SETS    "Kernel"
 Module_ComponentPath    SETS    "castle/RiscOS/Sources/Kernel"
-Module_FullVersion      SETS    "5.35 (4.79.2.98.2.48)"
-Module_HelpVersion      SETS    "5.35 (08 Aug 2011) 4.79.2.98.2.48"
+Module_FullVersion      SETS    "5.35 (4.79.2.98.2.49)"
+Module_HelpVersion      SETS    "5.35 (22 Aug 2011) 4.79.2.98.2.49"
                         END
diff --git a/VersionNum b/VersionNum
index 619ea65c9bec20ffb57a1be84ce7ee9de967f375..922adc32ed284ec8619a2443dfbaeef126e483e4 100644
--- a/VersionNum
+++ b/VersionNum
@@ -5,19 +5,19 @@
  *
  */
 #define Module_MajorVersion_CMHG        5.35
-#define Module_MinorVersion_CMHG        4.79.2.98.2.48
-#define Module_Date_CMHG                08 Aug 2011
+#define Module_MinorVersion_CMHG        4.79.2.98.2.49
+#define Module_Date_CMHG                22 Aug 2011
 
 #define Module_MajorVersion             "5.35"
 #define Module_Version                  535
-#define Module_MinorVersion             "4.79.2.98.2.48"
-#define Module_Date                     "08 Aug 2011"
+#define Module_MinorVersion             "4.79.2.98.2.49"
+#define Module_Date                     "22 Aug 2011"
 
-#define Module_ApplicationDate          "08-Aug-11"
+#define Module_ApplicationDate          "22-Aug-11"
 
 #define Module_ComponentName            "Kernel"
 #define Module_ComponentPath            "castle/RiscOS/Sources/Kernel"
 
-#define Module_FullVersion              "5.35 (4.79.2.98.2.48)"
-#define Module_HelpVersion              "5.35 (08 Aug 2011) 4.79.2.98.2.48"
+#define Module_FullVersion              "5.35 (4.79.2.98.2.49)"
+#define Module_HelpVersion              "5.35 (22 Aug 2011) 4.79.2.98.2.49"
 #define Module_LibraryVersionInfo       "5:35"
diff --git a/s/HAL b/s/HAL
index 12a398639c974dff8d5f9e7f511603ba51fb0c0e..f0d86371cccd2521379075fcaf98ed5f7fae6351 100644
--- a/s/HAL
+++ b/s/HAL
@@ -2416,25 +2416,34 @@ Reset_IRQ_Handler
         ORR     a3, a2, #SVC32_mode
         MSR     CPSR_c, a3
         Push    "a1-a2,lr"
+        ; If it's not an IIC interrupt, pass it on to the keyboard scan code
         LDR     v2, =ZeroPage
         AddressHAL v2
+        CallHAL HAL_IRQSource
         ADD     v1, v2, #IICBus_Base
-      [ ZeroPage <> 0
-        MOV     v2, #0
-      ]
+        MOV     ip, #0
 10
         LDR     a2, [v1, #IICBus_Type]
         TST     a2, #IICFlag_Background
-        MOVNE   ip, v2
-        BLNE    IICIRQ
-        ADD     v2, v2, #1
+        BEQ     %FT20
+        LDR     a2, [v1, #IICBus_Device]
+        CMP     a2, a1
+        ADREQ   lr, Reset_IRQ_Exit
+        BEQ     IICIRQ
+20
+        ADD     ip, ip, #1
         ADD     v1, v1, #IICBus_Size
-        CMP     v2, #IICBus_Count
+        CMP     ip, #IICBus_Count
         BNE     %BT10
-        LDR     a1, =ZeroPage+InitIRQWs
-        LDRB    a1, [a1, #KbdScanActive]
-        TEQ     a1, #0
+        LDRB    a2, [v2, #InitIRQWs+KbdScanActive]
+        TEQ     a2, #0
         CallHAL HAL_KbdScanInterrupt,NE
+        ; Keyboard scan code will have return -1 if it handled the IRQ
+        ; If it didn't handle it, or keyboard scanning is inactive, something
+        ; bad has happened
+        CMP     a1, #-1
+        CallHAL HAL_IRQDisable,NE ; Stop the rogue device from killing us completely
+Reset_IRQ_Exit
         Pull    "a1-a2,lr"
         MSR     CPSR_c, a2
         MSR     SPSR_cxsf, a1