Fix state functions in WriteFile