'Out of memory' errors were not being properly handled