Added better command-line argument parsing in diagnostic program