Fix command line arguments logic