fixes to generate properly formatted patterns.json