Patch for ckan issue 2009 - submitted as PR 2010