various fixes for TypeScript 0.9.1-1 and three.js r62.