fix couple of minor bugs