Fix: correct bounds for rand's range