Separate blocks into patterns. Add bug fixes for home template.