Fixed bugs that caused deviced added/removed notifications to be unreliable.