Some fixes related to error handling
Authored by: gyver309 2007-03-14
Parent: [r9259]
Child: [r9261]