some fixes for ms visual studio by Rainer Kuemmerle