Fixed detecting server port