Fixes error where it would fail on empty read.