fixed a minor bug reading in patterns