getopt function is very buggy, still.