A load of fixes to work properly with Pelican 3.1