Singularities of moduli spaces