Modified truncate helper. Added helper test.