fixed truncation bugs