cast to int to avoid false positive, add comments #3271