Replaced some OCaml exception by Toy exceptions.