Fixed python plugin to work with new layer factory.