fixed cross-platform issues