Add test cases for --with-nth option