Fixed a bug with 0 as a value. Added test around this case