Fix compile cast warnings present in VS