fix bug in restore_strings() & modify tests to cover the bug