apply changes and fixes from TPCombinators