Added assert to utils to try and catch NaNs.
Merge branch 'master' into feature-fisher