Some Windows specific bug-fixes