Fixed printing garbage in case of failed file open