Main modifications for Elgg 1.8 compatibility.