fixing issue with integer keys in dicts not being handled correctly