Added support for blocks with variable numbers of inputs and outputs