fix(errors): re-add code removed by a refactor

+add tests