Low level logging and handling of memory errors in impact_calculator. See #476