various minor bugs