Change some internal variables/parameters from int to size_t
update to latest TEA
merge trunk