bug-fixes to psm1 file