Added conditional on duohmm obj defined.