Fix invalid map creation