Fixed Fenoxo/sourceTiTS#211

Fenoxo/sourceTiTS#212
Fenoxo/sourceTiTS#213

Also fixed unrelated bug I noticed while I was testing.