Bug fix. Insert element into sorted aggregate list with same value.
Deal with empty windows.