Fixed minor bug in k-dim