Added allowed port checking.