Added error checking with getopt
Making sure all changes are committed for all files