Added fix for the strange input array shapes + tests