Support for fsync and bug fixes