fixed a couple of minor bugs