#4298 fixes for unit tests