Added assert to utils to try and catch NaNs.
Added instrumentation to try and detect NaNs in resampling, die in flames instead.