bug fix to pattern caching and fix for opacity on gradients