Fix a couple of minor bugs