Added the remove ports to the deletedevice method and more PDO conversions. #191 #164