Fixes #22

NaN output removed.
Fixes 20, 17, 16