Small fixes to accommodate QGIS 2.0 and 1.8