Fixed free() calls