port of fixes in C++ Wt