Fixes after terrible merge from ckan:master