Fixes crash when pressing back from tabbed view.