Fix NullPointerException on Windows 8.