parinfer 2017-12-08

@shaunlebron I finally had time to test out your fix - it looks great, thanks!

It fixes all 3 of those issues.

I wondered whether my Math.max hack would be required with your fix, #176 and #177 work without it but #173 (the original issue it fixed) still needs it.