Fix to work with current version of three.js