Fixed upgrade and added VS reference directives to client scripts