Fixes to postinstall script