Adding logging in some places.
Adding tests for dataset.