I think I have finally fixed a few bugs in plotting/saving which caused problems wen running via ssh with no access to display/X.