Fix grouping of statements when laoding data from dumps

This fixes issue #78.