Fix compiler warnings about assignment to unsigned