Updated getopts and made an automative chmod update