Bugfixes and get device name from build

Change-Id: I1224491c879acc31beea974850b5d8a97f17525d