fixed several pattern resizing bugs