fix some bugs, make panels

Thanks for suggestion for panels, @ktind.