Fixed display of layers, made mode change work