Backported [3804:3810] and [3813:3815] to 0.10-stable (fixes for #3654, #3677 and #3167)
Authored by: cboos 2006-10-02
Parent: [r3822]
Child: [r3824]