do-while related bugfix.