Fixes #2340

Pull request #2340 was never fixed with the EOF