Fix a bug when traversing partial lists.
Enable unit tests only for g++