Fixed bug in template roles migration