fix cmviewer: nan's are treated as 0