Windows 7 npe fix

npe fix for windows 7.