Add more protection against nan's