mend a few minor bugs