Fixed some bugs with internal switching wiping out callbacks