Fixes bug with Material loading