Fixed bug when migrating to QGIS 2.0