All looks great but crashed vs "NA/NaN/Inf in foreign function call (arg 3)" error