Fixes TypeError bug with non-physijs materials.