Minor bug-fix in API implementation.