Fix some code style issues.
Replace result pointer with unique_ptr.