Added unsigned cast to silence compiler warning