Added DeviceInfo class and various fixes