Fixed up some more bugs