improve pstat exception handing; add pstat --key option