Fix returning device entries with multiple user accounts attached.
Use the correct userid from the device, not the logged in admin user.
Remove debug file output.