Fix a bug related to using a different contents_template; add specs