Simplified port range handling and fixed case for odd ports number

Ignore-this: c735da00d2963af90f7de943891aff3

darcs-hash:20101013085409-b22ec-c62066e72763f780f2064b37fd9d5427740bcb15