Bug was introduced after refactoring of code.