Don't return a reference to a local variable, and removed a redundant API.