Added a few smart pointer usages. Adjusted documentation.