some fixes and make output more beautiful.