Fixed serialisation bug of the layers