fixed some bugs

Not really important