Fixed segfaults due to pyside bugs