Pull in some of the lpt_port_test fixes from lpt.c.