Changed to use non-deprecated API for layer and mdi-zorder.