manually applying @olegabr's bugfix request. Resolves #55.