#5270: add integration tests and fix bug they discovered due to module refacotring since original patch