Fixed a couple of minor bugs