Fix create intermetiate array. Closes #25