fix for dual mode

List splice was applied incorrectly, causing errors on Windows and
with clang on Mac.
Some code cleanup for dual mode