Minor Galloc improvement

....

These routines return NULL if they run out of memory. Some error checks. Did some minor alignment to affected routines.