Fix some issues with nested sequences