Fix crash on folding renamed layer

Signed-off-by: Marius Avram <marius.avram1309@gmail.com>