Fix file events (#673)