Clean up smart pointer use. Successful windows build.