Added ui_debug statements in several places.