fixed bug in opt_parse

was not resetting global getopt variables
which caused errors when opt_parse was called
after the first time.