Minor fix to the resource count migration and a post-save hook on models