If I understand the MPI format correctly, the bit (0x80) used to indicate a negative value is stored at the beginning of the bytestream, not the end. MPI format is big endian, most-significant bit (MSB) first, and the sign bit precedes all that.
CastToBool() appears to check for the sign bit at the end of the bytestream, rather than the beginning:
// Can be negative zero
if (i == vch.size()-1 && vch[i] == 0x80)
return false;