Fix mem leak and explains dark error