Adds timeout capability and fixes multi-device bug