Fix some loops

Also update the msvc project file