- fixes BTC106

- fixes BTC111
- fixes BTC158
- fixes some other things