Fix server port check