Fixed some bugs

Just minor stuff.