Fix back button functionality, other minor fixes