minor improvements to handling of OOM conditions