Error checks
https://sourceforge.net/tracker/?group_id=624136&atid=2789445
Authored by: robbod 2012-08-15
Parent: [r941]
Child: [r943]