Fixed a bug with sample 2 introduced after refactor.