Added changes from recent fixes.
Fixed popup width. Previous bugfix was incomplete.