Improved assertions in the port test
Shortened lines