Fixes in toDict()