Updating the code for compatibility with Cortex pull request 160.

We should make sure the pull request in Cortex go first.