Merge "Fail more gracefully on allocation failure" into klp-dev