Exit with error when run outside Git repository

Also some fix for some typos.