SmartPointer, Exceptions

Add exceptions
Smartpointer changed to smartpointer with counter