Code taken from columns meta branch.