Fixed an error handling in init.ps1.