bugfix history with 1 elem + pretty printing optimization