TS-3006: Fix compile warnings and errors. This closes #116.