diff --git a/cffi-kqueue.lisp b/cffi-kqueue.lisp
index d5a2f87..1a98df8 100644
--- a/cffi-kqueue.lisp
+++ b/cffi-kqueue.lisp
@@ -65,10 +65,15 @@
(let* ((sec (floor seconds))
(nanosec (floor (- seconds sec) 1/1000000000)))
(declare (type fixnum sec nanosec))
- (with-foreign-slots ((tv-sec tv-nsec) timespec '(:struct timespec))
+ (with-foreign-slots ((tv-sec tv-nsec) timespec (:struct timespec))
(setf tv-sec sec tv-nsec nanosec))))
(defun kevent (kq &key changes n-changes events n-events timeout)
+ (setf changes (or changes (null-pointer))
+ n-changes (or n-changes 0)
+ events (or events (null-pointer))
+ n-events (or n-events 0)
+ timeout (or timeout (null-pointer)))
(let ((n (c-kevent kq changes n-changes events n-events timeout)))
(declare (type (signed-byte 32) n))
(when (< n 0)