Fixed a bug with division by negative integer.