Fix Bugs

Some bugs were fixed