Fix wrong object reference for device NAC and cleanup logging