Fixing issue with negative numbers,  though make code faster.
Merge branch 'hotfix-1'