Add error handling, breaking some of the types