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

...n associated tests.