fixed command-line argument handling