bunch of fixes

- better encoding
- better error handling for view::TT module
- white space removal