Fix switching between views. Wasn't updating the view type correctly.