More bug fixes and support for ordered sets.