Changed the type of mSelected to unsigned and fixed the comparison, as suggested by Gabor Papp.