amendments to pull request #126

... mainly to deal with factory 4.0.0