CIDR fixes and test improvements.
Merge pull request #23 from yippibrian/cidr-fixes

CIDR fixes and test improvements.