Fix nested list JS code execution

See issue #574