Make errors from name duplication bubble up to the error handler.
Add more tests