Fixed version detection in detached head scenarios.
Bad xaml fixed #350