Fixed small bug which always run tree mode.