More work on device ports. Flawed logic will fix tonight. Mostly working. #191