Memory allocation fix.