'Visible navigation bar at the main screen' bug fixed and some related code optimized.