fix regressions in root2matplotlib and add unit tests

Fixes #451