Fix to pattern state, and addition of missing pattern state in code view for invidual patterns. #30