Fixing stat call on Mac