windows compiling + crash fix