Chg: slightly better error handling