Some explicit type casting to appease Visual Studio