Bug fixes for XP