Fixes and refactoring of SUB for lists