Various changes and fixes according to TPWD notes