Add save/restore tests after dompmsuspend; Fix some code bugs.