Fixed some bugs. Checking also the git status.