Added missing variable which caused exception when file raised IOError. Fixes #7