Bug fixes in truncate