Empty file handing

A fix for #101 (replaces #165).