Fix type cast warning in old VS versions