WIP: Fix memory leak from method_name.
WIP: Fail path needs to return NULL.
WIP: Fix memory leak of mps through error path.