Fix for issue #6916

Refs: http://hub.qgis.org/issues/6916