Fix lut/lut2 argument handling and add some tests for it