Upgraded to work with CKAN 2.2 and fixed issue#3