Fixed a few pdf /fig bugs