Fixed couple bugs with port module and extended port tests