Implemented handling of dataset boundaries.
Added handling of line endings.