Fixes for older Python/PyQt versions