Fix use of stat