Improve handling of dicts in property lists.

This ought to fix a number of problems with plist handling.