Fixed problem with matplotlib not working on headless server (without X windows running)