Various fixes to make sure the plugin still works in onlder versions of liferay