Fixes to device setup