Finally fixed bugs with command line inputs