Fix some errors and run test with matplotlib.
rr() still needs testing.