Fixes related to OS X compatibility

Requires custom compiled Qt 5.