Clean up navigation code.