'Only variables should be passed by reference' fix in toArray()
getErrors(), toNodes() and some tests are added