TS-1714 Fix some build problems with gcc-4.8