fixed some small errors
fixed some msvc errors and warnings