Mutable Binary Tree

My code seems to insert only the root, its left and right. Just the first level. Other nodes seem to be ignored.

The test code is this. Either the insertion code or the test code is wrong. Which one should I fix ?
The print code is in-order traversal.
Please ignore the inefficient data structure. I am transiitoning to the functional paradigm.

let%expect_test _=
  let tree =  ref None in
  let i = Bloomfilter__.Splaytree.insert_key 3 tree in
  let j = Bloomfilter__.Splaytree.insert_key 9 I in
  let k = Bloomfilter__.Splaytree.insert_key 2 j in
  let _l = Bloomfilter__.Splaytree.insert_key 6 k in
     Bloomfilter__Splaytree.print_splaytree  tree 1; 
    [%expect {|
        9
      3
        2 |}]
let rec insert_key (k : int ) (t : int splay_tree option ref) : int splay_tree option ref=
 match !t with
  | None ->
    let new_node = Node { key = k; value = 0; left = None; right = None } in
    t := Some new_node;
    t
    | Some tree  ->
    let  insert_node tree =

      match tree with
      |  Node old_key ->
        begin match old_key with
          |  ok  ->
            if k > ok.key then(
              match ok.right with
              | None ->
              let r = ref (Some (Node { key = k ;value = 0 ; right = Some Leaf; left = Some Leaf} ))in
               ok.right <- !r;
               t 
             | Some r ->
            insert_key k (ref (Some r))
            )
            else 
            if k < ok.key then(
              match ok.left with
              | None ->
              let l = ref (Some (Node { key = k ;value = 0 ; right = Some Leaf; left = Some Leaf} ))in
              ok.left <- !l;
              t 
             | Some l ->
            insert_key k (ref (Some l))
            )
            
          else
             t
            
        end;
     |Leaf ->t
    in
    insert_node tree

This is fixed by adding a pattern like this in two places. It is redundancy in the data structure that caused the bug.

 | None | Some Leaf ->