Compatibility fix for QGIS 1.8