Shared pointer issue - proposed error fix for issue #4

I think my compiler did a barrel roll after debugging this so many times. I also didn't have a direct way to run this, so further tests should be made upon this code actually being ran on your end - sorry about that, but just wanted to give you a heads up.

When I say tests, I state that in a manner of not running the parser - the C++ code was tested ... quite vigorously. :P Hope this helps.