Add rudimentary error throwing