Fix docs and simplify implementation of exception