Fix a few weird bugs caused by the Qt polyfill.