Add dataset, range, and some bugfix