Fixed issue with setting ports