Bugfix: declare and set "device" member.