Fix deprecation of nan() in julia v0.4
Merge pull request #52 from swt30/fix-deprecations-v0.4

Replace nan(T) with convert(T, NaN) to stop deprecation warnings in Julia v0.4