Fix the type of patterns matrices