Modify logic operation block to allow multiple inputs
Improve error checking