Pile of changes for supporting two's complement properly.