Fixing bug #8218

Fixing Bug#8218 http://hub.qgis.org/issues/8218