Bugfix in use of piddir variable