Fixed stat on OSX

Fix for the `stat` bug we discovered at OCD in Bern.