Minor tweaking for #81, changing exception used