Fix reset command

This pull request solves #422 , #368 and #412