Bugfix to ALLOCATE when memory allocation fails