Handle NaN and Infinity values on count widgets

Ref #977