fixed truncation bugs fixes #2