Made getDevice() return a const reference