Fixed window centering bug