Better error checking in free list code