Fixed important Bugs