Changes to append-text function.