Fixed some bugs

Small ones.