Added cleanup code for getopts