Cleared up errors resulting from moving a device between cabinets and added trim to the makesafe function. close #198