Fixing bug in adddataset().