Add truncate() and a couple small fixes