Corrected OS specific code to work for Windows 8.