Fix pid directory issues.