Fixed XP build and general cleanup