fix build on GCC 4.4

the usual problem: GCC 4.4 sometimes has problems to implicitly cast
std::shared_ptr<Foo> to std::shared_ptr<const Foo>. sorry for the
hiccup...