safeMap() replaced with fillMap() to fix failing tests