Replace reflex

Some bug fixes from Paul Russo in the code to replace the use of Reflex for ROOT6.
Please merge this into the ROOT 6  branch as soon as convenient.