fix problems found with valgrind with shifting stamps and saving