Fixes to devices API.