Changes backported from Pawel's fix to ckan_publisher_tree