some changes to make the code more robust
Authored by: dhosse 2015-03-05
Parent: [r32390]
Child: [r32392]