Fixed serialisation issue for maps with keys as primitive, String or
enum.