Fixing some bugs building datasets.