             maskLayer?.removeAnimationForKey("setupFade")
             
             // Generate animation if needed
-            gradientAnimation = {
-                if let previousAnimation = fader {
-                    return previousAnimation
-                } else {
-                    return keyFrameAnimationForGradient(fadeLength, interval: interval, delay: delay)
-                }
-            }()
+            if let previousAnimation = fader {
+                gradientAnimation = previousAnimation
+            } else {
+                gradientAnimation = keyFrameAnimationForGradient(fadeLength, interval: interval, delay: delay)
+            }
             
             // Apply scrolling animation
             maskLayer?.addAnimation(gradientAnimation!, forKey: "gradient")
+        } else {
+            // No animation needed
+            gradientAnimation = nil
         }
         
         let completion = CompletionBlock<MLAnimationCompletion>({ (finished: Bool) -> () in

        CATransaction.setAnimationDuration(transDuration)
        
        // Create gradient animation, if needed
        var gradientAnimation: CAKeyframeAnimation? = nil
        if fadeLength > 0.0 {
            // Remove any setup animation, but apply final values
            if let setupAnim = maskLayer?.animationForKey("setupFade") as? CABasicAnimation, finalColors = setupAnim.toValue as? [CGColorRef] {

        CATransaction.begin()
        CATransaction.setDisableActions(true)
        
        // Determine if gradient mask needs to be created
        let gradientMask: CAGradientLayer
        if let currentMask = self.maskLayer {
            // Mask layer already configured
            gradientMask = currentMask
        } else {
            // No mask exists, create new mask
            gradientMask = CAGradientLayer()
            gradientMask.shouldRasterize = true
            gradientMask.rasterizationScale = UIScreen.mainScreen().scale
            gradientMask.startPoint = CGPointMake(0.0, 0.5)
            gradientMask.endPoint = CGPointMake(1.0, 0.5)
            // Adjust stops based on fade length
            let leftFadeStop = fadeLength/self.bounds.size.width
            let rightFadeStop = fadeLength/self.bounds.size.width
            gradientMask.locations = [0.0, leftFadeStop, (1.0 - rightFadeStop), 1.0]
        }
        
        // Set up colors
        let transparent = UIColor.clearColor().CGColor
