NH-2408: tests and fix