Improve compatibility with VC2005, patch by Morten Ofstad!