Merged bug fix from other branch.