Replaces use of nan with 0/0.