interesting bug pre-refactor

In the process of refactoring to OO style (like in article example)