Core: Minor optimizations in window creation