changes to cmake for visual studios and tiny bugfix in main