Workarounds for matplotlib 1.4.2 bug.