Fix the issue in Multi-Dimension cases and Add testcases