Fix failures with Matplotlib