Fixed Bugs, added reset in case something goes wrong
Merge origin/master