Fixing issues with binary for multidimensional array