Some small fixes to pattern example JS