Fix a bug with getopt

Signed-off-by: eldr4d <nikofinas@gmail.com>