Removed erroneous test
Switched more code to dataset interface
Fixed unreachable code