Fix `to_dict` not converting enums to strings

Fixes #28