fix a couple minor bugs