Replace platform code correctly.