Merge pull request #8539 from leoetlino/fs-accuracy IOS/FS: Reimplement many functions in a more accurate way