Fixed os file bugs