Fixed some bugs

Fixed the most annoying bugs