Improved dimname assignment (added reshape, but I'm wary about overuse of reshape...)