Fixed some Bugs

Fixed problems