active index was incorrect, removing layers after they had non was crashing blender, now raise an error.