Merged relevant bugfixes from 0.2 branch.
Authored by: knut_f 2008-09-12
Parent: [r970]
Child: [r972]