Fixing enums parsing from maps and adding tests