Refined and fixed the PrintSnapshot tool