Remove debug msg, and fix minor bug.