Reimplemented fucked up subnet mask handling.