Fix number type issue in converting IP to number