fixed issue with twos-complement not converting correctly