Fixed cross-platform issues