Properly clear devices when going back.