Fix #8445

Please see http://hub.qgis.org/issues/8445