Minor refactoring; xfail added to one test.