Issue #524 Mask layer not applied when script layer not empty