Fix handling of shaped for 0-sized arrays.