Added total line with options; minor bug fixes