Fix two powershell script bugs