Adding NULL instead of printing error when no dimension matching + improved historical speed by not rebuilding the dims every time