fixed problem with new ports class and sanity checks