Don't try to read empty files.

Fixes #1237.