fixes issue where 0 is not being recorded as a value

Fixes #39

Missing tests for this, but it does solve the problem. All tests pass, so I decided to also simplify the logic here.