Typo in name of API function call.
Incorrect return value for error case.
Local variable no longer required.