Added compatibility.h that defines override in GCC < 4.7.
Return shared_ptr and not weak_ptr.