Add command line options and timeout catching