Bug fixes for the previous commit (r21498).
Authored by: bugman 2013-11-18
Parent: [r21498]
Child: [r21500]