Fixed a bug that was introduced when refactoring and noticed when starting benchmarks.