Cleaner fix for viewport errors on XP