Fix issue #1024 and #1052.
Merge pull request #1070 from AnalyticalGraphicsInc/cubeMapMaterials

Fix issue #1024 and #1052.