Windows specific bug fixes