Added calls to exit() to handle incorrect command line arguments