Bugfixes for bags and datatexts