Fixed dynamic window expansion. It works now.