Improve map_exceptions (+doctest)