Corrected missing allocate for some variables