Get rid of all the debug messages for now and use references and not copies of boost::shared_pointer objects.