Changes to avoid "SetAppThreadPriority: setpriority failed..." errors