A few fixes based on the unit tests problems.
Authored by: semor 2009-01-27
Parent: [r8686]
Child: [r8688]