Warning fixes.
Makes the code that manage the kinect device shared.