Fix no-window issue + some stuff