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...
Merge pull request #101 from andlaus/fix_build

fix build on GCC 4.4