Added fix for setting port and check in nlsrc to avoid segfault