Fixed up some small bugs