fix bug with negative numbers (version 0.8.0)

Change-Id: Ibe6c2eec974ab2d4d5ac0e2e4bcbc5fcb70dadc2
(cherry picked from commit fe32b5df78acf796d6496656304ed17c00e8d17c)