Bugfix: getRandomInt(): wrong loop