fixed bug in adjust prefs of resource exchange and context constructor in associated tests.