Updated for recent three.js changes