Make sure to also handle error return from getopt