diff --git a/src/main.rs b/src/main.rs
index d000fcdac74fb06fe7eb1156a06b67cc266a117d..755771196e2e85df464aee29aa96d83a3597fff5 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -349,7 +349,14 @@ fn check_user_presence(cid: ChannelID) -> Result<(), Ctap2StatusCode> {
 
         // Setup a keep-alive callback.
         let keepalive_expired = Cell::new(false);
-        let mut keepalive_callback = timer::with_callback(|_, _| {
+        let mut drivers = match libtock::retrieve_drivers() {
+            Ok(x) => x,
+            Err(err) => {
+                panic!("Drivers were already taken when attempting to retrieve them");
+            }
+        };
+        let mut timer_context = drivers.timer;
+        let mut keepalive_callback = timer_context.with_callback(|_, _| {
             keepalive_expired.set(true);
         });
         let mut keepalive = keepalive_callback.init().unwrap();
diff --git a/src/usb_ctap_hid.rs b/src/usb_ctap_hid.rs
index 36c5118ee757705b745f3e4c5f2aa10f50e5250b..8e35151a1c19e36588ec32c2fa22a40c5560762f 100644
--- a/src/usb_ctap_hid.rs
+++ b/src/usb_ctap_hid.rs
@@ -17,10 +17,8 @@ use core::cell::Cell;
 use core::fmt::Write;
 #[cfg(feature = "debug_ctap")]
 use libtock::console::Console;
-//use libtock::result::TockValue;
 use libtock::result::{EALREADY, EBUSY, SUCCESS};
 use libtock::syscalls;
-use libtock::timer;
 use libtock::timer::{Duration};
 
 const DRIVER_NUMBER: usize = 0x20009;
@@ -238,7 +236,14 @@ fn recv_with_timeout_detail(
 
     // Setup a time-out callback.
     let timeout_expired = Cell::new(false);
-    let mut timeout_callback = timer::with_callback(|_, _| {
+    let mut drivers = match libtock::retrieve_drivers() {
+        Ok(x) => x,
+        Err(err) => {
+            panic!("Drivers were already taken when attempting to retrieve them");
+        }
+    };
+    let mut timer_context = drivers.timer;
+    let mut timeout_callback = timer_context.with_callback(|_, _| {
         timeout_expired.set(true);
     });
     let mut timeout = match timeout_callback.init() {
@@ -331,7 +336,14 @@ fn send_or_recv_with_timeout_detail(
 
     // Setup a time-out callback.
     let timeout_expired = Cell::new(false);
-    let mut timeout_callback = timer::with_callback(|_, _| {
+    let mut drivers = match libtock::retrieve_drivers() {
+        Ok(x) => x,
+        Err(err) => {
+            panic!("Drivers were already taken when attempting to retrieve them");
+        }
+    };
+    let mut timer_context = drivers.timer;
+    let mut timeout_callback = timer_context.with_callback(|_, _| {
         timeout_expired.set(true);
     });
     let mut timeout = match timeout_callback.init() {
@@ -355,17 +367,21 @@ fn send_or_recv_with_timeout_detail(
     // Cleanup alarm callback.
     match timeout.stop_alarm(timeout_alarm) {
         Ok(()) => (),
-        Err(TockValue::Expected(StopAlarmError::AlreadyDisabled)) => {
-            if !timeout_expired.get() {
-                #[cfg(feature = "debug_ctap")]
-                writeln!(
-                    Console::new(),
-                    "The send/receive timeout already expired, but the callback wasn't executed."
-                )
-                .unwrap();
+        Err(err) => {
+            match err.return_code {
+                EALREADY => {
+                    if !timeout_expired.get() {
+                        #[cfg(feature = "debug_ctap")]
+                        writeln!(
+                            Console::new(),
+                            "The send/receive timeout already expired, but the callback wasn't executed."
+                        )
+                            .unwrap();
+                    }
+                },
+                _ => panic!("Unexpected error when stopping alarm: {:?}", err.return_code),
             }
-        }
-        Err(e) => panic!("Unexpected error when stopping alarm: {:?}", e),
+        },
     }
 
     // Cancel USB transaction if necessary.