Fix back button behaviour.