some fixes for VS compatibility