bug fixes and cleanup.  Was getting some crashes from weakpwh output.