Slightly improving the way we handle errors in map