Improved isDml condition.