Bugfix on twos-complement-p, clean up bit-sum