Fix test-case and improve command-line interface