Add explicit cast to fix compiler warning