fixed bug in dimensionality mis-match