Fixed a bug with the compiler

if there are more materials than geometries provided, we were creating
null materials in our scene (which led to the load function failing on
the browser side).  This is fixed.