Fix BaggingMachine based on @karlnapf feedback