fix truncate center and add tests