Fixed issue with stat returning incorrect modes.