Handle case when fileName is nil

Resolves issue #19