[core] Fix and improve platform specific functions