Added some diagnostic messages when allocation fails.