Fix computation of multiple and one-element dimensions