Fixes to ensure variables are properly initialised, code is portable and is usable with preset NaNs?.