Rework device definition
Cleanup, set corret flags for com objects