bugfix in error logging in dataset.py, and added a test in test_dataset to test exceptions