Close #171: fix IllegalArgumentException