Backport API call to Lion.
Fix bug for avicenna.