merging peicopy. some unit tests broke