Updated for compatibility with newer versions of boost.  Just needed to change calls of shared_polymorphic_downcast to dynamic_pointer_cast.  Tested and confirmed working with boost versions 1.49-1.55