Fixes to ensure Plone 4 compatibility