Added better exception error for unbalanced shapes.