Fix IP subnet matching