[SPARK-4409] Modified horzcat and vertcat