Fix IP CIDR mask parsing and unit tests