Fix TypeError: an integer is required

If a custom port is defined in the collector config, it's not
converted to an int.