Bug fix: splice(0) -> slice(0) for array copy