Fixed a few bugs

Branch from Visualstudio Addon