Fixed cross platform issues