Fixes for some big mistakes in the previous commit.
Authored by: bugman 2014-05-28
Parent: [r23499]
Child: [r23501]