fix GH-8: cloneNode interface was changed
cleanup: missing var is added, unused variable is deleted