Merge pull request #318 from benjello/master

Add Error when NaNs are created during calculation
Removing unused variable