Added scaling of patterns.