Multiple bug fixes in PowerShell code for WAPack