Some minor changes to pattern.js.