Fixes error when end offset is not set.