Clone data before bundling and fix default value for sort type