fix typo (not sure why Bool compiled) and add include to define NAN