Fixed up some minor bugs