Minor bug fix to adapt with changing API.