Fix bug with multiple stack block last input