Fix error when handling command line arguments