EOF detection: use range operator

This didn't seem to have much affect on test data.