fixed widget output and a few other bugs