fix for bug  #726884 in Debian
some more changes to increase testability