Fixed syscall write and read for files