Added compatibility code for Visual Studio