Updated to work correctly on Win XP