fix a couple of minor bugs